package com.smasher.net.http.convert

import kotlinx.serialization.json.Json
import okhttp3.MediaType.Companion.toMediaType
import retrofit2.Converter
import retrofit2.converter.kotlinx.serialization.asConverterFactory

class KotlinConverterFactory : ConverterFactory {

    override fun createFactory(): Converter.Factory {
        return Json.asConverterFactory(MEDIA_TYPE_JSON.toMediaType())
    }

    companion object {
        private const val MEDIA_TYPE_JSON = "application/json"
    }
}